#!/bin/bash

if [ $# -lt 2 ];then
	echo "请指定两个数值参数"
else
	SUM=0
	if [ $1 -lt $2 ];then
		for((i=$1;i<=$2;i++))
		do
			SUM=$[$SUM + $i]
		done
	elif [ $1 -eq $2 ];then
		SUM=$1
	else
		for((i=$2;i<=$1;i++))
		do
			SUM=$[$SUM + $i]
		done
	fi
	echo "和为：$SUM"
fi
